import request from '@/utils/request'
import { CHECC_API_CMS } from '@/constants/proxy'
import { exportMethod } from '@/utils/utils'
const getProductList = (params) => {
  return request.post(
    CHECC_API_CMS +
      `/xmzx/acceptanceProcess/getProductList?current=${params.current}&size=${params.size}&projectName=${params.projectName}`
  )
}
const terminate = (params: any = {}) => {
  return request.post(CHECC_API_CMS + `/xmzx/acceptanceProcess/update`, params)
}
const acceptanceProjects = (params: any = {}) => {
  return request.post(CHECC_API_CMS + `/xmzx/acceptanceProcess/reportApproval`, params)
}
const acceptanceSave = (params: any = {}) => {
  return request.post(CHECC_API_CMS + `/xmzx/acceptanceProcess/insert`, params)
}
const examineReportSave = (params: any = {}) => {
  return request.post(CHECC_API_CMS + `/xmzx/acceptanceProcess/report`, params)
}
const getDetail = (id) => {
  return request.post(CHECC_API_CMS + `/xmzx/acceptanceProcess/reportDetail?id=` + id)
}
const getExamineDetail = (id) => {
  return request.post(CHECC_API_CMS + `/xmzx/acceptanceProcess/releaseDetail?id=` + id)
}
const examineSave = (params: any = {}) => {
  return request.post(CHECC_API_CMS + `/xmzx/acceptanceProcess/insert`, params)
}
const saveToDeal = (params) => {
  return request.post('/process-api/proc-center-case-task/insert', params)
}
const dealedReport = (params) => {
  return request.post('/process-api/proc-center-case-task/updateDo?id=' + params)
}
//导出
export function getExportExcel(data) {
  const params = {
    method: 'post',
    url: CHECC_API_CMS + '/xmzx/acceptanceProcess/export',
    fileName: '过程审查列表',
    data: data,
  }
  return exportMethod(params)
}
export {
  getProductList,
  terminate,
  acceptanceProjects,
  getDetail,
  getExamineDetail,
  acceptanceSave,
  examineReportSave,
  examineSave,
  saveToDeal,
  dealedReport
}
